<template>
    {{title}}--{{name}}
    <Child ref="childRef" :title="title" :name.sync="name" @changeTitle="changeTitle" />
    <button @click="change"> 主动修改</button>
</template>
<script>
export default {
    components: {
        Child: () => import('./child.vue')
    },
    data() {
        return {
            title: '标题',
            name:'李四'
        }
    },
    methods:{
        changeTitle(data){
            this.title = data
        },
        change(){
            this.$refs.childRef?.handleName()
        }
    }
}
</script>
